// 请求封装
import axios from "../plugins/axios";
// import qs from 'querystring';

// 设置公共请求头
export const baseUrl = "https://api-hmugo-web.itheima.net";
axios.defaults.baseURL = `${baseUrl}/api/public/v1`;
// 设置请求头token
axios.defaults.headers.common["Authorization"] = sessionStorage.getItem(
    "token"
);

// 获取首页轮播图
export const getHomeBanner = () => axios.get("/home/swiperdata");
// 获取首页商品信息
export const getHomeGoodslist = () => axios.get("/home/goodslist");

// 获取分类
export const getCate = () => axios.get("/categories");
// 获取商品详情
export const getGoodsDetail = (id) => axios.get("/goods/detail?goods_id=" + id);
